package com.xxx.car.controller;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Callable;

import javax.servlet.AsyncContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/web")
public class WebController {

	
	@RequestMapping("/test")
	public Callable<Map<String, String>> admin(final HttpServletRequest req, final HttpServletResponse resp) throws IOException{
		System.out.println(Thread.currentThread().getName());
		AsyncContext asyncCtx = req.startAsync(); 
		return new Callable<Map<String, String>>() {
			@Override
			public Map<String, String> call() throws Exception {
				Map<String, String> map = new HashMap<>();
				System.out.println("call--"+Thread.currentThread().getName());
				map.put("name", "zhaiyuyong");
				return map;
			}  
		  };
	}
}
